<template>
  <div @click="show">
    文件不存在 + {{url}}
  </div>
</template>

<script>
export default {
  name: "Pdf",
  data() {
    return {
      url: undefined
    }
  },
  methods: {
    show() {
      console.log(this.$route);
    }
  },
  mounted() {
    let query = this.$route.query;
    let id = query.id;
    let fileType = query.fileType;
    let filename = query.filename;
    let subNo = query.subNo;
    if (id) {
      this.url = process.env.VUE_APP_BASE_URL + '/file/' + id;
    } else {
      return;
    }

    if (filename) {
      this.url += '/' + filename + "." + fileType;
    }

    if (subNo) {
      this.url += '#page=' + subNo;
    }
    window.location.href = this.url;
  },
}
</script>

<style scoped>

</style>